----------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/parkerrogers/Dropbox/MedicalInnovationProjects/CivilWarProject/Restat_Replication/LogFiles/C
> onfederatePatentAnalysis.log
  log type:  text
 opened on:  18 May 2023, 14:49:15

. 
. **** Basic Time Series Figures
. use "Data/all_patents_basicinfo.dta", clear

. 
. **** Initial time series graphs for full database of patents
. gen confederatestates = 0

. replace confederatestates = 1 if inv_state1 == "tx" | inv_state1 == "ar" | inv_state1 == "la" | inv_state1 == 
> "tn" | inv_state1 == "ms" | inv_state1 == "al" 
(359,287 real changes made)

. replace confederatestates = 1 if inv_state1 == "ga" | inv_state1 == "fl" | inv_state1 == "sc" | inv_state1 == 
> "nc" | inv_state1 == "va"  
(297,888 real changes made)

. keep if confederatestates == 1
(8,252,551 observations deleted)

. 
. gen prosthetics = 0

. replace prosthetics = 1 if nclassgoogle1 == 623
(2,315 real changes made)

. 
. rename iyear year

. keep patnum year nclassgoogle1 inv_state1 prosthetics

. append using "Data/ConfederatePatentsCleaned.dta" 

. 
. keep if year >= 1855 & year <= 1875 
(651,267 observations deleted)

. 
. gen confederatepatent = 0

. replace confederatepatent = 1 if patnum < 300
(266 real changes made)

. gen patentcount = 1

. collapse (sum) patentcount, by(prosthetics year)

. tsset prosthetics year
       panel variable:  prosthetics (unbalanced)
        time variable:  year, 1855 to 1875, but with gaps
                delta:  1 unit

. tsfill, full

. replace patentcount = 0 if patentcount == .
(14 real changes made)

. 
. // Panel B, Figure 1: Patent Time Series Contrasting Regions Directly Impacted by the US Civil War and World W
> ar I with Regions That Were Not
. twoway (tsline patentcount if year >= 1855 & year <= 1875 & prosthetics == 1, xline(1862, lcolor(black) lpatte
> rn(dash)) xline(1867, lcolor(black) lpattern(dash)) lwidth(medthick)) (tsline patentcount if year >= 1855 & ye
> ar <= 1875 & prosthetics != 1, yaxis(2) lpattern(dash) lwidth(medthick)), ytitle(Prosthetic Patents) ytitle(Al
> l Other Patents, axis(2)) title(Civil War Era Patents: Confederacy, color(black)) ylabel(0(2)8) ylabel(0(500)1
> 500, axis(2)) xlabel(1855(5)1875) legend(label(1 "Prosthetics") label(2 "All Other")) graphregion(fcolor(white
> )) scale(0.9) name(LimbsVsOtherCivilWarConfederates, replace) 

. graph export "Figures/LimbsVsOtherCivilWarConfederates.pdf", name(LimbsVsOtherCivilWarConfederates)  replace
(file /Users/parkerrogers/Dropbox/MedicalInnovationProjects/CivilWarProject/Restat_Replication/Figures/LimbsVsOt
> herCivilWarConfederates.pdf written in PDF format)

. 
. capture log close
